package xjtu.se.articlecommunity.user.register.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {

    @Insert("insert into t_user(u_id, u_mail, u_passwd) values(#{uid}, #{mail}, #{Password})")
    public void addUser(@Param("uid") String uid,@Param("mail") String mail,@Param("Password") String Password);

    @Select("select count(1) from t_user where u_mail=#{mail} or u_id=#{mail} or u_tel=#{mail}")
    public int ifUserExist(@Param("mail") String mail);

    @Select("select u_passwd from t_user where u_mail=#{mail} or u_id=#{mail} or u_tel=#{mail}")
    public String password(@Param("mail") String mail);
}
